import time


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

d=webdriver.Edge()
#访问网址
d.get("http://127.0.0.1/ranzhi/www")
time.sleep(3)
#用户名和密码输入并登陆
locator = ("id","account")
input = WebDriverWait(d,5,0.5).until(expected_conditions.presence_of_element_located(locator))
d.find_element(By.ID,'account').send_keys('admin')
d.find_element(By.ID,'password').send_keys('123456')
locator1 = ("id","submit")
input1 = WebDriverWait(d,5,0.5).until(expected_conditions.presence_of_element_located(locator1))
d.find_element('id','submit').click()
locator2 = ("class name","dock-bottom")
input2 = WebDriverWait(d,20,0.5).until(expected_conditions.presence_of_element_located(locator2))
d.find_element('class name','dock-bottom').click()
locator3 = ("class name","fullscreen-btn")
input3 = WebDriverWait(d,20,0.5).until(expected_conditions.presence_of_element_located(locator3))
d.find_element('class name','fullscreen-btn').click()
time.sleep(5)

